hawk icon indicating copy to clipboard operation
hawk copied to clipboard

[WIP] adopt hwk's command-line API

Open gelisam opened this issue 3 years ago • 5 comments

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
  • [x] make it clearer what the default mode is

gelisam avatar Jul 03 '21 02:07 gelisam

It now builds back to lts-10.7.

juhp avatar Jul 03 '21 10:07 juhp

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

juhp avatar Jul 03 '21 15:07 juhp

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

But hawk -e '2+2' works.

juhp avatar Jul 03 '21 15:07 juhp

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

gelisam avatar Aug 01 '21 10:08 gelisam

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

juhp avatar Aug 02 '21 12:08 juhp