850 |
}]) |
}]) |
851 |
|
|
852 |
|
|
853 |
|
# AS_HELP_STRING(LHS, RHS, [COLUMN]) |
854 |
|
# ---------------------------------- |
855 |
|
# |
856 |
|
# Format a help string so that it looks pretty when |
857 |
|
# the user executes "script --help". This macro takes three |
858 |
|
# arguments, a "left hand side" (LHS), a "right hand side" (RHS), and |
859 |
|
# the COLUMN which is a string of white spaces which leads to the |
860 |
|
# the RHS column (default: 26 white spaces). |
861 |
|
# |
862 |
|
# The resulting string is suitable for use in other macros that require |
863 |
|
# a help string (e.g. AC_ARG_WITH). |
864 |
|
# |
865 |
|
# Here is the sample string from the Autoconf manual (Node: External |
866 |
|
# Software) which shows the proper spacing for help strings. |
867 |
|
# |
868 |
|
# --with-readline support fancy command line editing |
869 |
|
# ^ ^ ^ |
870 |
|
# | | | |
871 |
|
# | column 2 column 26 |
872 |
|
# | |
873 |
|
# column 0 |
874 |
|
# |
875 |
|
# A help string is made up of a "left hand side" (LHS) and a "right |
876 |
|
# hand side" (RHS). In the example above, the LHS is |
877 |
|
# "--with-readline", while the RHS is "support fancy command line |
878 |
|
# editing". |
879 |
|
# |
880 |
|
# If the LHS is contains more than (COLUMN - 3) characters, then the LHS |
881 |
|
# is terminated with a newline so that the RHS starts on a line of its |
882 |
|
# own beginning with COLUMN. In the default case, this corresponds to |
883 |
|
# an LHS with more than 23 characters. |
884 |
|
# |
885 |
|
# Therefore, in the example, if the LHS were instead |
886 |
|
# "--with-readline-blah-blah-blah", then the AS_HELP_STRING macro would |
887 |
|
# expand into: |
888 |
|
# |
889 |
|
# |
890 |
|
# --with-readline-blah-blah-blah |
891 |
|
# ^ ^ support fancy command line editing |
892 |
|
# | | ^ |
893 |
|
# | column 2 | |
894 |
|
# column 0 column 26 |
895 |
|
# |
896 |
|
m4_define([AS_HELP_STRING], |
897 |
|
[m4_pushdef([AS_Prefix], m4_default([$3], [ ]))dnl |
898 |
|
m4_pushdef([AS_Prefix_Format], |
899 |
|
[ %-]m4_eval(m4_len(AS_Prefix) - 3)[s ])dnl [ %-23s ] |
900 |
|
m4_text_wrap([$2], AS_Prefix, m4_format(AS_Prefix_Format, [$1]))dnl |
901 |
|
m4_popdef([AS_Prefix_Format])dnl |
902 |
|
m4_popdef([AS_Prefix])dnl |
903 |
|
]) |
904 |
|
|
905 |
|
|
906 |
|
|
907 |
## ------------------------------------ ## |
## ------------------------------------ ## |
908 |
## Common m4/sh character translation. ## |
## Common m4/sh character translation. ## |