cmd_line
index
e:\projects\soft_tools\smart_hasher\repo\smart_hasher\smart_hasher\cmd_line.py

 
Modules
       
argparse
enum
functools
hash_calc
smart_hasher

 
Classes
       
enum.IntEnum(builtins.int, enum.Enum)
ExitCode

 
class ExitCode(enum.IntEnum)
    ExitCode(value, names=None, *, module=None, qualname=None, type=None, start=1)
 
Code with values less than 7 are considered like OK, and program can continue execution
Ref: https://docs.python.org/3.7/library/enum.html
Ref: https://stackoverflow.com/questions/6060635/convert-enum-to-int-in-python
 
 
Method resolution order:
ExitCode
enum.IntEnum
builtins.int
enum.Enum
builtins.object

Data and other attributes defined here:
APP_USAGE_ERROR = <ExitCode.APP_USAGE_ERROR: 12>
DATA_READ_ERROR = <ExitCode.DATA_READ_ERROR: 9>
EXCEPTION_THROWN_ON_PROGRAM_EXECUTION = <ExitCode.EXCEPTION_THROWN_ON_PROGRAM_EXECUTION: 10>
FAILED = <ExitCode.FAILED: 7>
INVALID_COMMAND_LINE_PARAMETERS = <ExitCode.INVALID_COMMAND_LINE_PARAMETERS: 11>
OK = <ExitCode.OK: 0>
OK_SKIPPED_ALREADY_CALCULATED = <ExitCode.OK_SKIPPED_ALREADY_CALCULATED: 2>
PROGRAM_INTERRUPTED_BY_USER = <ExitCode.PROGRAM_INTERRUPTED_BY_USER: 8>

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Data descriptors inherited from enum.EnumMeta:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
Functions
       
parse_cmd_line()
Ref: "Argparse Tutorial" https://docs.python.org/3/howto/argparse.html
Ref: "15.4.3. The add_argument() method" https://docs.python.org/2/library/argparse.html#the-add-argument-method

 
Data
        exit_code_descriptions = {<ExitCode.OK: 0>: 'everthing fine. Program executed successfully', <ExitCode.OK_SKIPPED_ALREADY_CALCULATED: 2>: 'everything fine. OK may be returned anyway\n ...s skipped because the hash is already calculated.', <ExitCode.FAILED: 7>: 'general failure, more specific information is not available.', <ExitCode.DATA_READ_ERROR: 9>: 'there was error(s) when reading some file(s). Probably hash is not calculated for all files', <ExitCode.APP_USAGE_ERROR: 12>: 'incorrect usage of the application'}