Closed
Description
Specification
The secrets ls
command will list the contents of a directory.
There are 3 main features to support here.
- List directory normally
- List in list format
-l
- Include hidden files with
-a
- Paths can support wildcards and globing.
- Multiple paths can be specified.
stdin
is ignored
Polykey/tmp/asd on staging [?]
❯ ls
asdasd best dir1 dir2 one test two
Polykey/tmp/asd on staging [?]
❯ ls -l
total 32
-rw-r--r-- 1 brian operators 8 Jul 11 11:18 asdasd
-rw-r--r-- 1 brian operators 15 Jul 11 11:18 best
drwxr-xr-x 2 brian operators 2 Jul 11 11:19 dir1
drwxr-xr-x 2 brian operators 2 Jul 11 11:19 dir2
-rw-r--r-- 1 brian operators 0 Jul 11 11:18 one
-rw-r--r-- 1 brian operators 5 Jul 11 11:18 test
-rw-r--r-- 1 brian operators 0 Jul 11 11:18 two
Polykey/tmp/asd on staging [?]
❯ ls -a
. .. asdasd best dir1 dir2 .hidden one test two
Polykey/tmp/asd on staging [?]
❯ ls *est
best test
Polykey/tmp/asd on staging [?]
❯ ls **/*
asdasd best dir1/a dir2/b dir2/c one test two
dir1:
a
dir2:
b c
Polykey/tmp/asd on staging [?]
❯ ls -l **/*
-rw-r--r-- 1 brian operators 8 Jul 11 11:18 asdasd
-rw-r--r-- 1 brian operators 15 Jul 11 11:18 best
-rw-r--r-- 1 brian operators 0 Jul 11 11:42 dir1/a
-rw-r--r-- 1 brian operators 0 Jul 11 11:43 dir2/b
-rw-r--r-- 1 brian operators 0 Jul 11 11:43 dir2/c
-rw-r--r-- 1 brian operators 0 Jul 11 11:18 one
-rw-r--r-- 1 brian operators 5 Jul 11 11:18 test
-rw-r--r-- 1 brian operators 0 Jul 11 11:18 two
dir1:
total 1
-rw-r--r-- 1 brian operators 0 Jul 11 11:42 a
dir2:
total 1
-rw-r--r-- 1 brian operators 0 Jul 11 11:43 b
-rw-r--r-- 1 brian operators 0 Jul 11 11:43 c
❯ ls **/*
asdasd best dir1/a dir2/b dir2/c one test two
dir1:
a
dir2:
b c
Additional context
Related #32
Tasks
- Implement
secrets ls
command - Support the default format.
- Support the list
-l
format - Files and directory's that start with
.
should be hidden unless-a
is used. - Support wild cards and globing.
- Support specifying multiple paths.
- Seamlessly support using normal and secret paths.