longbox

comic book stash manager
git clone git://git.pyratebeard.net/longbox.git
Log | Files | Refs | README

commit 4d6fddac74279c9334d98981f6ab55b00c364176
parent de9a92ea9e3c4552c0727f44eed2ff9d4e6167d0
Author: pyratebeard <root@pyratebeard.net>
Date:   Thu, 29 Sep 2022 22:28:47 +0100

parse args

Diffstat:
Mlongbox | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/longbox b/longbox @@ -10,6 +10,7 @@ #░ imports import os +import argparse #░ local database dir def get_db_dir(): @@ -45,3 +46,19 @@ wishdb = os.path.join(dbpath, 'wishlist.db') confpath = get_conf_dir() mkdirs(confpath) boxrc = os.path.join(confpath, 'longboxrc') + +# parse arguments +parser = argparse.ArgumentParser(description = "comic book stash manager") +parser.add_argument("-q", "--query", help = "search for stuff", required = False, action='store', nargs='+') +parser.add_argument("-i", "--issue-id", help = "show specific issue id", required = False, default = None) +parser.add_argument("-s", "--series-id", help = "list all issues in series", required = False, default = None) +parser.add_argument("--show-variants", help = "show issue variants", required = False, action = 'store_true') +subparsers = parser.add_subparsers(help = "manage your stash", dest="stash") + +parser_stash = subparsers.add_parser("stash", help = "manage your stash") +parser_stash.add_argument("-s", "--series-id", help = "list all issues in series", required = False, default = None) +parser_stash.add_argument("-c", "--category", help = "list or create a category", required = False, default = 'unsorted') +parser_stash.add_argument("-i", "--stash-issue", help = "stash specific issue", required = False, default = None) +parser_stash.add_argument("--show-variants", help = "show issue variants", required = False, action = 'store_true') + +argument = parser.parse_args()