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

Show aliased functions in the -h output. #69

Merged
merged 1 commit into from
Oct 28, 2022
Merged

Show aliased functions in the -h output. #69

merged 1 commit into from
Oct 28, 2022

Conversation

skx
Copy link
Owner

@skx skx commented Oct 28, 2022

This pull request closes #68 by showing aliased functions specially in the output of yal when running with "-h".

For example:

$ ./yal  -h hms
hms
===
hms is an alias for time:hms.

time:hms
========
Return the current time as a string, formatted as 'HH:MM:SS'.

zero-pad-single-number (num:number)
===================================
Return the given number, padded to two digits, as a string.
i.e. Add a '0' prefix to the specified number, for values less than ten.

This is designed to pad the hours, minutes, and seconds in (hms).

When called via (help) everything works as-is, so there is no mention of the alias when this code runs:

(print (help hms))

(Because we don't have access to the name, to lookup the function, we just the result, when our arguments are expanded.)

This pull request closes #68 by showing aliased functions specially
in the output of yal when running with "-h".

For example:

```
$ ./yal  -h hms
hms
===
hms is an alias for time:hms.

time:hms
========
Return the current time as a string, formatted as 'HH:MM:SS'.

zero-pad-single-number (num:number)
===================================
Return the given number, padded to two digits, as a string.
i.e. Add a '0' prefix to the specified number, for values less than ten.

This is designed to pad the hours, minutes, and seconds in (hms).

```

When called via `(help)` everything works as-is, so there is no
mention of the alias when this code runs:

```
(print (help hms))
```

(Because we don't have access to the name, to lookup the function,
we just the result, when our arguments are expanded.)
@skx skx merged commit 0061f96 into master Oct 28, 2022
@skx skx deleted the 68-alias branch October 28, 2022 02:29
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.

report aliases in our help
1 participant