coreutils
coreutils copied to clipboard
Implement seq
This is a tracking issue for the seq
util.
Required options and flags:
- [ ]
f
(long:format
) - [X]
s
(long:separator
) - [ ]
t
(long:terminator
) - [X]
w
(long:equal-width
, visible-alias:fixed-width
)
Notes: ¹ : Long name not defined on other implementation of this utility. Implementer must choose a long name. ² : Short name (one letter) not defined on other implementation of this utility. Implementer must choose. a short name
References
Seq Linux Seq FreeBSD Seq NetBSD Seq DragonflyBSD
Unresolved questions:
None yet
History
The -w
and -s
were implemented by #125
Open issue for -f
: #127
Hi, planning to work on this issue. Planning to do the following:
- Create a branch,
cli/seq
frommaster
- Create a
seq
member based onsleep
- Replicate
man seq
in terms of options and documentation - Write code
Any other advice or guidelines such as testing as well?
Yes one advice
Always drop manually everything that needs to when std::process::exit()
As for testing, I do not have something more strict because we have lots of stuff that the result depends on the running system configuration, and I have no idea how to create tests for these cases.
But overall, everything that are not those cases, I would like tests cases. I usually give very descriptive names for test functions like <function name>_<case>
Example:
I have a function called myfunc
that takes one bool parameter, so my test function names would be myfunc_true
and myfunc_false
I guess that's all that I can think on top of my head
Have fun with the project :smile:
Hi @GrayJack, not sure if @FrancisMurillo is working on this. I had few hours to work on this one, please review the PR -https://github.com/GrayJack/coreutils/pull/125
Just missing -f
flag now
I just notice that when all 3 args are the same (1 1 1, or 2 2 2) it wont print the value
With default seq
seq 1 1 1
Has output of
1
this version only exit without showing the number
Heya, I'd like to take a crack at adding the -f
flag and fixing this behavior so seq 1 1 1
operates as expected!
Hi @GrayJack I couldn't reproduce the 1 1 1
problem from the dev branch.
Running seq 1 1 1
returns 1
, as expected, when built using MacOS and Linux targets.
Hi @lynnpepin, I believe the error in the behavior was fixed on PR #154 , but the -f
flag remains unimplemented
Sorry, I forgot to mention here that the issue was fixed.
Understood! Focusing on the -f
flag
Hey @GrayJack I'm going to call it quits on implementing -f
. Couldn't figure it out, and I've definitely overcommited a bit! I think I need to tackle some more Rust before trying again.
As it stands, a good first issue for anyone else!