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

Supports OSX and fix example test #45

Merged
merged 5 commits into from
Jun 17, 2022
Merged

Conversation

yanagiragi
Copy link
Contributor

The PR aim to support and fix:

  1. Current script does not support OSX

    Mentioned in Gawk installation location incorrect on MacOS #24 , I tried adding #!/usr/bin/env -S gawk -f, however the option -S only works on BSD distributions. The proper way to handle shebang would been execute shdoc using the way mentoned in here. However my approach is to simply replace shebang when install in Makefile.

  2. Example does not work

    The main reason is that the regex to capture function name does not support hyphen (-), which turns out included in the example. So I simply add a \- in the regex.

  • Latest commit output:
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  ~/Desktop/Ragi/shdoc-original(master*) » ./shdoc examples/readme-example.sh                                                                                                                                    
  zsh: ./shdoc: bad interpreter: /usr/bin/gawk: no such file or directory
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  ~/Desktop/Ragi/shdoc-original(master*) » sed 's/\/usr\/bin\/gawk/\/usr\/local\/bin\/gawk/' shdoc > new-shdoc # temporarily hack                                                                            127 
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  ~/Desktop/Ragi/shdoc-original(master*) » chmod u+x new-shdoc                                                                                                                                                   
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  ~/Desktop/Ragi/shdoc-original(master*) » ./new-shdoc examples/readme-example.sh                                                                                                                                
  # libexample
  
  A library that solves some common problems.
  
  ## Overview
  
  The project solves lots of problems:
  * a
  * b
  * c
  * etc
  
  • Latest commit output from forked project:
  ~/Desktop/Ragi/shdoc(master*) » ./new-shdoc examples/readme-example.sh                                                                                                                                           
  # libexample
  
  A library that solves some common problems.
  
  ## Overview
  
  The project solves lots of problems:
  * a
  * b
  * c
  * etc
  
  ## Index
  
  * [say-hello()](#say-hello)
  
  ### say-hello()
  
  My super function.
  Not thread-safe.
  
  #### Example
  
  ```bash
  echo "test: $(say-hello World)"
  ```
  
  #### Arguments
  
  * **$1** (string): A value to print
  
  #### Exit codes
  
  * **0**: If successful.
  * **1**: If an empty string passed.
  
  #### See also
  
  * [validate()](#validate)
  

@yanagiragi
Copy link
Contributor Author

I found another issue: The anchor name is mismatched.

 ## Index
  
  * [say-hello()](#say-hello) << not match!
  
 ### say-hello()

Fixed in 433a0ba by remove parentheses in the generated headers

@kovetskiy
Copy link
Member

Hi, could you please fix the tests? They work correctly, but they expected an incorrect result.

@yanagiragi
Copy link
Contributor Author

@kovetskiy Fixed.

@yanagiragi
Copy link
Contributor Author

Hi, any updates?

@kovetskiy kovetskiy merged commit 05b3ab5 into reconquest:master Jun 17, 2022
@kovetskiy
Copy link
Member

Merged, thanks!

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