Skip to content

Commit 21f688b

Browse files
committed
srfit_app.py
1 parent 935f5e5 commit 21f688b

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

src/diffpy/srfit/srfit_app.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import argparse
2+
3+
from diffpy.srfit.version import __version__
4+
5+
6+
def main():
7+
parser = argparse.ArgumentParser(
8+
prog="diffpy.srfit",
9+
description=(
10+
"Generalized code base for modeling problems.\n\n"
11+
"For more information, visit: "
12+
"https://github.com/diffpy/diffpy.srfit/"
13+
),
14+
formatter_class=argparse.RawDescriptionHelpFormatter,
15+
)
16+
17+
parser.add_argument(
18+
"--version",
19+
action="store_true",
20+
help="Show the program's version number and exit",
21+
)
22+
23+
args = parser.parse_args()
24+
25+
if args.version:
26+
print(f"diffpy.srfit {__version__}")
27+
else:
28+
# Default behavior when no arguments are given
29+
parser.print_help()
30+
31+
32+
if __name__ == "__main__":
33+
main()

0 commit comments

Comments
 (0)