Skip to content

Implement secrets ls command #245

Closed
Closed
@tegefaulkes

Description

@tegefaulkes

Specification

The secrets ls command will list the contents of a directory.

There are 3 main features to support here.

  1. List directory normally
  2. List in list format -l
  3. Include hidden files with -a
  4. Paths can support wildcards and globing.
  5. Multiple paths can be specified.
  6. 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

  1. Implement secrets ls command
  2. Support the default format.
  3. Support the list -l format
  4. Files and directory's that start with . should be hidden unless -a is used.
  5. Support wild cards and globing.
  6. Support specifying multiple paths.
  7. Seamlessly support using normal and secret paths.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions