
import argparse as ap
from os.path import isdir

from .csft import print_result


def main(argv=None):
    parser = ap.ArgumentParser(add_help='add help')
    parser.add_argument('path', help='the directory to be analyzed')
    args = parser.parse_args(args=argv)
    if not isdir(args.path):
        raise TypeError('%s is not a directory!', args.path)
    return print_result(args.path)


if __name__ == '__main__':
    raise SystemExit(main())


import argparse as ap
from os.path import isdir

from . import __name__ as _name
from . import __version__ as _version
from .csft import print_result


def main(argv=None):
    """ Execute the application CLI. """
    parser = ap.ArgumentParser(prog=_name)
    parser.add_argument('-V', '--version', action='version', version=_version)
    parser.add_argument('path', help='the directory to be analyzed')
    args = parser.parse_args(args=argv)
    if not isdir(args.path):
        raise TypeError('%s is not a directory!', args.path)
    return print_result(args.path)


if __name__ == '__main__':
    raise SystemExit(main())

Add version option to CLI.
Add version option to CLI.

  
  import argparse as ap
  from os.path import isdir
  
+ from . import __name__ as _name
+ from . import __version__ as _version
  from .csft import print_result
  
  
  def main(argv=None):
-     parser = ap.ArgumentParser(add_help='add help')
+     """ Execute the application CLI. """
+     parser = ap.ArgumentParser(prog=_name)
+     parser.add_argument('-V', '--version', action='version', version=_version)
      parser.add_argument('path', help='the directory to be analyzed')
      args = parser.parse_args(args=argv)
      if not isdir(args.path):
          raise TypeError('%s is not a directory!', args.path)
      return print_result(args.path)
  
  
  if __name__ == '__main__':
      raise SystemExit(main())
  
Add version option to CLI.
## Code Before:

import argparse as ap
from os.path import isdir

from .csft import print_result


def main(argv=None):
    parser = ap.ArgumentParser(add_help='add help')
    parser.add_argument('path', help='the directory to be analyzed')
    args = parser.parse_args(args=argv)
    if not isdir(args.path):
        raise TypeError('%s is not a directory!', args.path)
    return print_result(args.path)


if __name__ == '__main__':
    raise SystemExit(main())

## Instruction:
Add version option to CLI.
## Code After:

import argparse as ap
from os.path import isdir

from . import __name__ as _name
from . import __version__ as _version
from .csft import print_result


def main(argv=None):
    """ Execute the application CLI. """
    parser = ap.ArgumentParser(prog=_name)
    parser.add_argument('-V', '--version', action='version', version=_version)
    parser.add_argument('path', help='the directory to be analyzed')
    args = parser.parse_args(args=argv)
    if not isdir(args.path):
        raise TypeError('%s is not a directory!', args.path)
    return print_result(args.path)


if __name__ == '__main__':
    raise SystemExit(main())
