Skip to content

Command.args() has no command line visibility #17

Description

@unicornsasfuel

It would be useful to have visibility into the command line being completed in Command.args().

For instance, if you wanted to do bash-style path completion, you could simply:

from ishell.console import Console
from ishell.command import Command
import glob

class ExampleCommand(Command):
   def args(self, line):
      line_without_command_name = ''.join(line.split()[1:])
      return glob.glob(line_without_command_name + '*')
   def run(self, line):
      print "This is an example command."

example = ExampleCommand('example', dynamic_args=True)
console = Console()
console.addChild(example)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions