Skip to content

func names should identify the source lib #19

@jinal--shah

Description

@jinal--shah

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions