def __init__(self, argv): ap = argparse.ArgumentParser() ap.add_argument('--version', action='version', version=__version__) ap.add_argument('account', help='account to be used. Typically the (P)ID of the '\ 'resource to be accounted') ap.add_argument('value', help='The value to be recorded') ap.add_argument('unit', nargs='?', default='byte', help='The unit of measurement for the value provided. '\ 'Default: "byte"') ap.add_argument('-b', '--base_url', default='https://accounting.eudat.eu', help='base URL of the accounting server to use. '\ 'Default: https://accounting.eudat.eu') ap.add_argument('-u', '--user', default='', help='user id used for logging into the server. '\ 'If not provided it is looked up in the environment variable '\ '"ACCOUNTING_USER". ' \ 'Default: "" - aka not set') ap.add_argument('-p', '--password', default='', help='password used for logging into the server. '\ 'If not provided it is looked up in the environment variable '\ '"ACCOUNTING_PW". ' \ 'Default: "" - aka not set') ap.add_argument('-d', '--domain', default='eudat', help='name of the domain holding the account. '\ 'Default: eudat') ap.add_argument('-s', '--service', default='', help='UID (or PID) of the registered service component reporting '\ 'the record. '\ 'Default: "" - not set') ap.add_argument('-n', '--number', default='', help='number of objects associated with this accounting record. '\ 'This is EUDAT specific. '\ 'Default: "" - not set') ap.add_argument('-o', '--object_type', default='registered objects', help='object type for the number of objects specified with "-n". '\ 'This is EUDAT specific. '\ 'Default: "registered objects"') utils.addCommonArguments(ap) self.args = ap.parse_args(args=argv[1:]) """Arguments of your app"""
def __init__(self, argv): ap = argparse.ArgumentParser() ap.add_argument('--version', action='version', version=__version__) ap.add_argument('-c', '--configpath', default='./irodscollector.cfg', help='path to configuration file. '\ 'Default: "./irodscollector.cfg" (in the current working directory)') utils.addCommonArguments(ap) self.args = ap.parse_args(args=argv[1:]) # sneak in some default values that the utility functions expect self.args.unit = 'byte' self.args.service = '(default)' # XXX TODO: should this come from the config? self.args.object_type = 'registered object' """Arguments of your app"""