def work(argv)
      # all -h equivalent to --help
      argv = argv.map { |a| a == '-h' ? '--help' : a }
      idx = argv.index { |c| !c.start_with?('-') }
      preoption = idx.nil? ? argv.shift(argv.size) : argv.shift(idx)

      # handle --version or --help or nothing
      return show("SeccompTools Version #{SeccompTools::VERSION}") if preoption.include?('--version')
      return show(USAGE) if idx.nil?

      # let's handle commands
      cmd = argv.shift
      argv = %w[--help] if preoption.include?('--help')
      return show(invalid(cmd)) if COMMANDS[cmd].nil?

      COMMANDS[cmd].new(argv).handle
    end
def work(argv)
      # all -h equivalent to --help
      argv = argv.map { |a| a == '-h' ? '--help' : a }
      idx = argv.index { |c| !c.start_with?('-') }
      preoption = idx.nil? ? argv.shift(argv.size) : argv.shift(idx)

      # handle --version or --help or nothing
      return show("SeccompTools Version #{SeccompTools::VERSION}") if preoption.include?('--version')
      return show(USAGE) if idx.nil?

      # let's handle commands
      cmd = argv.shift
      argv = %w[--help] if preoption.include?('--help')
      return show(invalid(cmd)) if COMMANDS[cmd].nil?

      COMMANDS[cmd].new(argv).handle
    end
Main working method of CLI.
 @param [Array<String>] argv
   Command line arguments.
 @return [void]
 @example
   work(%w[--help])
   #=> # usage message
   work(%w[--version])
   #=> # version message