Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main(args=None):
parser = argparse.ArgumentParser(description="nbsite commands")
subparsers = parser.add_subparsers(title='available commands')
init_parser = subparsers.add_parser("init", help=inspect.getdoc(init))
_add_common_args(init_parser,'--project-root','--doc')
init_parser.add_argument('--theme', type=str, help='sphinx theme to use in template', choices=['holoviz', ''], default='')
_set_defaults(init_parser,init)
generaterst_parser = subparsers.add_parser("generate-rst", help=inspect.getdoc(generate_rst))
_add_common_args(generaterst_parser,'--project-root','--doc','--examples', '--overwrite')
generaterst_parser.add_argument('--project-name', type=str, help='name of project')
generaterst_parser.add_argument('--host',type=str,help='host to use when generating notebook links',default='GitHub')
generaterst_parser.add_argument('--org',type=str,help='github organization',default='')
generaterst_parser.add_argument('--repo',type=str,help='name of repo',default='')
generaterst_parser.add_argument('--branch',type=str,help='branch to point to in notebook links',default='master')
generaterst_parser.add_argument('--offset',type=int,help='number of cells to delete from top of notebooks',default=0)
generaterst_parser.add_argument('--nblink',type=str,help='where to place notebook links',choices=['bottom', 'top', 'both', 'none'], default='bottom')
generaterst_parser.add_argument('--skip',type=str,help='notebooks to skip running; comma separated case insensitive re to match',default='')
generaterst_parser.add_argument('--keep-numbers',action='store_true',help='whether to keep the leading numbers of notebook URLs and titles')
_set_defaults(generaterst_parser,generate_rst)