diff options
-rwxr-xr-x | README.md | 2 | ||||
-rw-r--r-- | cmd2/parsing.py | 10 | ||||
-rwxr-xr-x | setup.py | 8 | ||||
-rw-r--r-- | tests/test_parsing.py | 22 |
4 files changed, 5 insertions, 37 deletions
@@ -23,7 +23,7 @@ Main Features - Python scripting of your application with ``pyscript`` - Run shell commands with ``!`` - Pipe command output to shell commands with `|` -- Redirect command output to file with `>`, `>>`; input from file with `<` +- Redirect command output to file with `>`, `>>` - Bare `>`, `>>` with no filename send output to paste buffer (clipboard) - `py` enters interactive Python console (opt-in `ipy` for IPython console) - Option to display long output using a pager with ``cmd2.Cmd.ppaged()`` diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 75bbd1c4..a6e67096 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -175,15 +175,6 @@ class StatementParser(): args = testargs tokens = [] - # check for input from file - inputFrom = None - try: - input_pos = tokens.index('<') - inputFrom = ' '.join(tokens[input_pos+1:]) - tokens = tokens[:input_pos] - except ValueError: - pass - # check for output redirect output = None output_to = None @@ -239,7 +230,6 @@ class StatementParser(): result.command = command result.args = args result.terminator = terminator - result.inputFrom = inputFrom result.output = output result.output_to = output_to result.pipe_to = pipe_to @@ -10,9 +10,9 @@ from setuptools import setup VERSION = '0.9.0' DESCRIPTION = "cmd2 - a tool for building interactive command line applications in Python" -LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make -it quick and easy for developers to build feature-rich and user-friendly interactive command line applications. It -provides a simple API which is an extension of Python's built-in cmd module. cmd2 provides a wealth of features on top +LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make +it quick and easy for developers to build feature-rich and user-friendly interactive command line applications. It +provides a simple API which is an extension of Python's built-in cmd module. cmd2 provides a wealth of features on top of cmd to make your life easier and eliminates much of the boilerplate code which would be necessary when using cmd. The latest documentation for cmd2 can be read online here: @@ -25,7 +25,7 @@ Main features: - Python scripting of your application with ``pyscript`` - Run shell commands with ``!`` - Pipe command output to shell commands with `|` - - Redirect command output to file with `>`, `>>`; input from file with `<` + - Redirect command output to file with `>`, `>>` - Bare `>`, `>>` with no filename send output to paste buffer (clipboard) - `py` enters interactive Python console (opt-in `ipy` for IPython console) - Multi-line commands diff --git a/tests/test_parsing.py b/tests/test_parsing.py index eb26c47d..4ca6838e 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -145,23 +145,6 @@ def test_output_redirect_append(parser): assert statement.output == '>>' assert statement.output_to == '/tmp/afile.txt' -def test_parse_input_redirect(parser): - line = '< afile.txt' - statement = parser.parse(line) - assert statement.inputFrom == 'afile.txt' - -def test_parse_input_redirect_after_command(parser): - line = 'help < afile.txt' - statement = parser.parse(line) - assert statement.command == 'help' - assert statement.args == '' - assert statement.inputFrom == 'afile.txt' - -def test_parse_input_redirect_with_dash_in_path(parser): - line = '< python-cmd2/afile.txt' - statement = parser.parse(line) - assert statement.inputFrom == 'python-cmd2/afile.txt' - def test_pipe_and_redirect(parser): line = 'output into;sufx | pipethrume plz > afile.txt' statement = parser.parse(line) @@ -254,11 +237,6 @@ def test_parse_redirect_to_unicode_filename(parser): assert statement.output == '>' assert statement.output_to == 'café' -def test_parse_input_redirect_from_unicode_filename(parser): - line = '< café' - statement = parser.parse(line) - assert statement.inputFrom == 'café' - def test_empty_statement_raises_exception(): app = cmd2.Cmd() with pytest.raises(cmd2.cmd2.EmptyStatement): |