Skip to content

Commit

Permalink
edit : init_argparse function separated from main.
Browse files Browse the repository at this point in the history
  • Loading branch information
sadrasabouri committed Oct 15, 2024
1 parent 13512a4 commit b141267
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions samila/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from .genimage import GenerativeImage


def main():
def init_argparse():
"""
CLI main function.
Initialize argparse.
:return: None
:return: parser
"""
parser = argparse.ArgumentParser()
parser.add_argument('--version', help='version', action='store_true', default=False)
Expand Down Expand Up @@ -61,6 +61,17 @@ def main():
parser.add_argument('--save-data', help='save data', type=str)
parser.add_argument('--save-config', help='save config', type=str)
parser.add_argument('--no-display', help='no display', action='store_true', default=False)

return parser


def main():
"""
CLI main function.
:return: None
"""
parser = init_argparse()
args = parser.parse_args()

if args.version:
Expand Down

0 comments on commit b141267

Please sign in to comment.