Before executing the command, it may be necessary to check args and flags. If there are illegal arguments, an error should be returned directly.
Include but not limit to the following possible checks:
cat, sign, tee
- if
src is a dir, cat (sign, tee): src: Is a directory should return
cp and move
- if
src is a dir, --recursive option is required
- if there are multiple srcs,
dst should be a directory
- if
src == dst, cp: 'src' and 'dst' are the same error should return (similarly, Dir(src) == dst)
- if
dst is the subdirectory of src, maybe we should reject?
rm
- if
src is a dir, --recursive option is required
Before executing the command, it may be necessary to check args and flags. If there are illegal arguments, an error should be returned directly.
Include but not limit to the following possible checks:
cat,sign,teesrcis a dir,cat (sign, tee): src: Is a directoryshould returncpandmovesrcis a dir,--recursiveoption is requireddstshould be a directorysrc == dst,cp: 'src' and 'dst' are the sameerror should return (similarly,Dir(src) == dst)dstis the subdirectory ofsrc, maybe we should reject?rmsrcis a dir,--recursiveoption is required