Skip to content

Commit 84e4b84

Browse files
committed
readlink: Error on missing arguments
1 parent ba033be commit 84e4b84

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/readlink.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ def readlink(opts, paths: list[Path]):
107107

108108
opts, args = parser.parse_args()
109109

110+
if not args:
111+
parser.error("missing operand")
112+
110113
if opts.no_newline and len(args) > 1:
111114
print("ignoring --no-newline with multiple arguments", file=sys.stderr)
112115
opts.no_newline = False

0 commit comments

Comments
 (0)