Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] adopt hwk's command-line API #264

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

[WIP] adopt hwk's command-line API #264

wants to merge 17 commits into from

Conversation

gelisam
Copy link
Owner

@gelisam gelisam commented Jul 3, 2021

TODO:

  • fix the tests
  • default to not splitting into words
  • delete the now-unused homemade argument-parsing library
  • delete the now-unused Spec types
  • implement the missing modes (except Shell)
  • update the documentation
  • make it clearer what the default mode is

@juhp
Copy link
Collaborator

juhp commented Jul 3, 2021

It now builds back to lts-10.7.

/home/runner/work/hawk/hawk/src/System/Console/Hawk.hs:25:0: error:
Error:      error: missing binary operator before token "("
       25 | #if !MIN_VERSION_simple_cmd_args(0,1,3)
          |
@juhp
Copy link
Collaborator

juhp commented Jul 3, 2021

The tests are now passing but likely still missing some mode handling.

@juhp
Copy link
Collaborator

juhp commented Jul 3, 2021

Hmm, hawk '2+2' also fails locally for me :-(

But hawk -e '2+2' works.

@gelisam
Copy link
Owner Author

gelisam commented Aug 1, 2021

Hmm, hawk '2+2' also fails locally for me :-(

But hawk -e '2+2' works.

Looks like the default behaviour when no flags are specified switched from printing a value to splitting lines into words and applying a transformation on each of them:

> $ echo "hello world" | hawk 'reverse'
world hello

@juhp
Copy link
Collaborator

juhp commented Aug 2, 2021

processSpec (src/System/Console/Hawk.hs) still needs to handle each HawkMode.

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