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

func names should identify the source lib #19

Open
jinal--shah opened this issue Jul 4, 2019 · 0 comments
Open

func names should identify the source lib #19

jinal--shah opened this issue Jul 4, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@jinal--shah
Copy link
Contributor

jinal--shah commented Jul 4, 2019

To provide better visibility of which lib file a func comes from, it would be better to rename them to include the group (lib file identifying string) as a prefix.
We should use the double colon separator.

e.g.
git_branch() in habitual/git.functions becomes git::branch.

To provide backwards compatibility, we should add the original funcs as wrappers that call the newly named funcs (passing all args)

e.g.

# git_func() { local foo="$1" ; echo $foo ; } # original std.functions
git::func() { local foo="$1" ; echo $foo ; } # renamed original

# ... and then lower down in the file ...
#####################################################################
# @section DEPRECATED FUNCTIONS
#####################################################################
# @desc. Renamed - see [git::func()](#git__func).
git_func() { git::func "$*" ; } # new wrapper for backwards compatibility

The deprecated wrapper functions should be moved to the bottom of the lib, so they appear in docs appropriately under their own section heading.
Bash doc for the wrapper should indicate that this old func name is deprecated

@jinal--shah jinal--shah changed the title rename funcs with group prefix (use colons) func names should identify the source lib Jul 4, 2019
@jinal--shah jinal--shah added the enhancement New feature or request label Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant