Skip to content

Commit

Permalink
changed stdin parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Feb 18, 2024
1 parent 5569cec commit f1588b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cat_win/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from cat_win.const.argconstants import ALL_ARGS, ARGS_EDITOR, ARGS_WORDCOUNT, ARGS_WWORDCOUNT
from cat_win.const.argconstants import ARGS_HELP, ARGS_NUMBER, ARGS_ENDS, ARGS_SQUEEZE
from cat_win.const.argconstants import ARGS_REVERSE, ARGS_SUM, ARGS_BLANK, ARGS_FILES
from cat_win.const.argconstants import ARGS_INTERACTIVE, ARGS_NOCOL, ARGS_BINVIEW, ARGS_FILE_PREFIX
from cat_win.const.argconstants import ARGS_STDIN, ARGS_NOCOL, ARGS_BINVIEW, ARGS_FILE_PREFIX
from cat_win.const.argconstants import ARGS_CLIP, ARGS_CHECKSUM, ARGS_DEC, ARGS_HEX, ARGS_BIN
from cat_win.const.argconstants import ARGS_VERSION, ARGS_DEBUG, ARGS_CUT, ARGS_REPLACE, ARGS_DATA
from cat_win.const.argconstants import ARGS_CCONFIG, ARGS_LLENGTH, ARGS_ONELINE, ARGS_PEEK
Expand Down Expand Up @@ -1112,7 +1112,7 @@ def main():
for valid_url in valid_urls])
known_files.extend(list(temp_files.keys()))
holder.set_temp_files_url(temp_files)
if holder.args_id[ARGS_INTERACTIVE]:
if holder.args_id[ARGS_STDIN]:
piped_input = ''.join(stdinhelper.get_stdin_content(holder.args_id[ARGS_ONELINE]))
temp_file = stdinhelper.write_file(piped_input, tmp_file_helper.generate_temp_file_name(),
arg_parser.file_encoding)
Expand Down
6 changes: 3 additions & 3 deletions cat_win/const/argconstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, short_form: str, long_form: str, arg_help: str, arg_id: int,


ARGS_HELP, ARGS_NUMBER, ARGS_ENDS, ARGS_EDITOR, ARGS_SQUEEZE = range(0, 5)
ARGS_REVERSE, ARGS_SUM, ARGS_BLANK, ARGS_FILES, ARGS_INTERACTIVE = range(5, 10)
ARGS_REVERSE, ARGS_SUM, ARGS_BLANK, ARGS_FILES, ARGS_STDIN = range(5, 10)
ARGS_CLIP, ARGS_CHECKSUM, ARGS_DEC, ARGS_HEX, ARGS_BIN = range(10, 15)
ARGS_VERSION, ARGS_DEBUG, ARGS_CUT, ARGS_REPLACE, ARGS_DATA = range(15, 20)
ARGS_CCONFIG, ARGS_LLENGTH, ARGS_ONELINE, ARGS_PEEK, ARGS_NOCOL = range(20, 25)
Expand Down Expand Up @@ -75,8 +75,8 @@ def __init__(self, short_form: str, long_form: str, arg_help: str, arg_id: int,
# different content types
ArgConstant('-E', '--echo', 'handle every following parameter as stdin',
ARGS_ECHO, show_arg_on_shell=False, section=4),
ArgConstant('-i', '--interactive', 'use stdin',
ARGS_INTERACTIVE, show_arg_on_shell=False, section=4),
ArgConstant('-', '--stdin', 'use stdin',
ARGS_STDIN, show_arg_on_shell=False, section=4),
ArgConstant('-o', '--oneline', 'take only the first stdin-line',
ARGS_ONELINE, section=4),
ArgConstant('-U', '--url', 'display the contents of any provided url',
Expand Down
2 changes: 1 addition & 1 deletion cat_win/tests/test_argconstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ def test_no_concats(self):
parameters = parameters_short_form + parameters_long_form
for param in parameters:
self.assertEqual(param[:1], '-')
if not param.startswith('--'):
if not param.startswith('--') and param != '-':
self.assertEqual(len(param), 2)

0 comments on commit f1588b9

Please sign in to comment.