コード例 #1
0
ファイル: pathtags.py プロジェクト: jmcantrell/pathtags
def get_arguments():
    a = Arguments(description="File tagging system that uses the filesystem for storage.")
    a.add_argument('files', metavar='FILE', help="a file to use for tagging")
    a.add_argument('-d', '--directory', metavar='PATH', default='.', help='use PATH as the tag directory')
    a.add_argument('-t', '--tag', action='append', help='add TAG to tags')
    a.add_argument('-a', '--add-tags', action='store_true', help='add TAGS to filename')
    a.add_argument('-r', '--remove-tags', action='store_true', help='remove TAGS from filename')
    a.add_argument('--list-tags', action='store_true', help='list tags')
    a.add_argument('--list-paths', action='store_true', help='list paths')
    a.add_argument('--repair', metavar='PATH', help='repair tag using PATH as the source')
    return a.parse_args()
コード例 #2
0
ファイル: __main__.py プロジェクト: jmcantrell/wally
def get_arguments(): #{{{1
    a = Arguments(description="Tool for managing desktop backgrounds.")
    a.add_argument('-v', '--verbose', default=False, action='store_true', help='be verbose')
    a.add_argument('-t', '--target', default=None, type='int', help='restrict to specific monitor')
    a.add_argument('-c', '--command', default=None, type='choice', choices=WALLPAPER_COMMANDS, help='command to change wallpaper')
    a.add_argument('-r', '--refresh', default=False, action='store_true', help='refresh the display')
    a.add_argument('-s', '--search', metavar='REGEX', action='append', help='search filenames based on REGEX')
    a.add_argument('-x', '--exclude', metavar='REGEX', action='append', help='exclude filenames based on REGEX')
    a.add_argument('-g', '--gui', default=False, action='store_true', help='use gui mode')
    return a.parse_args()
コード例 #3
0
ファイル: igrep.py プロジェクト: jmcantrell/igrep
def get_arguments():  # {{{1
    a = Arguments(description="Find image files by attributes.")
    a.add_argument('paths', metavar='PATH', nargs='+', help="path to search for images")
    a.add_argument('-r', '--recursive', action='store_true', help='recurse into directories')
    a.add_argument('-a', '--aspect', help='search by aspect ratio (ex: 4:3)')
    a.add_argument('-v', '--invert-match', action='store_true', help='invert the search logic')
    a.add_argument('-W', '--width', type=int, help='specify width')
    a.add_argument('-H', '--height', type=int, help='specify height')
    a.add_argument('-I', '--info', action='store_true', help='display image information')
    return a.parse_args()