Skip to content

CLI now accepts strings as stdin#15

Merged
fdncred merged 6 commits into
nushell:mainfrom
AucaCoyan:main
Jun 5, 2023
Merged

CLI now accepts strings as stdin#15
fdncred merged 6 commits into
nushell:mainfrom
AucaCoyan:main

Conversation

@AucaCoyan
Copy link
Copy Markdown
Contributor

Finally I modified clap to accept either a file or a string.

It came with a couple of architectural changes:

  • ➖ I decided to clean the Session struct, because it wasn't really relevant to have it.
  • Input was also a rock the way to interpret files to format. So also it was deleted for better code readability
  • ➕ I added 2 functions: format_single_file and format_string that redirects the code to format_inner, where the code is formatted. The first 2 functions have the responsibility of reading & writing the file, or writing to stdout respectably.

@AucaCoyan AucaCoyan mentioned this pull request Jun 5, 2023
22 tasks
@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Jun 5, 2023

Looking good! Thanks again!

@fdncred fdncred merged commit 0b42976 into nushell:main Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants