def _subparse_format_notebook(subparsers): subparser_format_notebook = subparsers.add_parser( "format_notebook", aliases=["format", "fmt", "f"], help="Format notebooks." ) option_indexes(subparser_format_notebook) option_files(subparser_format_notebook) option_all(subparser_format_notebook) subparser_format_notebook.set_defaults(func=format_notebook)
def _subparse_trash(subparsers): subparser_trash = subparsers.add_parser( "trash", aliases=["t"], help="Move posts to the trash directory." ) option_indexes(subparser_trash) option_all(subparser_trash) option_files(subparser_trash) subparser_trash.set_defaults(func=trash)
def _subparse_format_notebook(subparsers): desc = "Format notebooks." subparser_format_notebook = subparsers.add_parser( "format_notebook", aliases=["format", "fmt", "f"], help=desc, description=desc, ) option_indexes(subparser_format_notebook) option_files(subparser_format_notebook) option_all(subparser_format_notebook) subparser_format_notebook.add_argument( "--yapf-config", dest="yapf_config", default="", help="The configuration file to use for yapf.") subparser_format_notebook.set_defaults(func=format_notebook)
def _subparse_match_post(subparsers): subparser_match_post = subparsers.add_parser( "matchpost", aliases=["mp" + i for i in INDEXES], help="match post name and title" ) option_indexes(subparser_match_post) option_all(subparser_match_post) subparser_match_post.add_argument( "-n", "--name", dest="name", action="store_true", help="Match the post title with its name." ) subparser_match_post.add_argument( "-t", "--title", dest="title", action="store_true", help="Match the post name with its title." ) subparser_match_post.set_defaults(func=match_post)