mad --list basename -a error #16

Closed
tonegenerated opened this Issue Oct 31, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@ghost

ghost commented Oct 31, 2012

Description

Running the list command on a GNU/Linux system (Ubuntu 12.10) generates this error:

user@host:~/src/text/mad$ mad -l

  mad pages:

basename: invalid option -- 'a'
Try `basename --help' for more information.

Solution

Using information derived from:

Change /bin/mad, replace:

     && find $path -type f -print0 \
      | xargs -0 basename -a \

with:

     && find $path -type f \
      | xargs -n1 basename \

results in:

#
# List all <pages>
#

list_pages() {
  IFS=":"
  local paths="$MAD_PATH:/usr/local/share/mad:/usr/share/mad"

  echo
  printf "  \033[1mmad pages:\033[0m\n"
  echo
  for path in $paths; do
    test ! -z $path \
      && test -d $path \
      && find $path -type f \
      | xargs -n1 basename \
      | grep -iv 'readme*' \
      | grep '.md$' \
      | perl -pe 's|^(.*)\.md$|    \1|;'
  done
  echo
}

From my research, this fix should work in both GNU/Linux and BSD. The -printf "%f\n" solution given on the SuperUser Stack Exchange appears to be specific to GNU/Linux.

@flexd

This comment has been minimized.

Show comment Hide comment
@flexd

flexd Dec 10, 2012

Contributor

I am also experiencing this, on both Arch linux and Ubuntu.

Contributor

flexd commented Dec 10, 2012

I am also experiencing this, on both Arch linux and Ubuntu.

flexd added a commit to flexd/mad that referenced this issue Dec 10, 2012

@tj

This comment has been minimized.

Show comment Hide comment
@tj

tj Dec 15, 2012

Owner

merged! thanks

Owner

tj commented Dec 15, 2012

merged! thanks

@tj tj closed this Dec 15, 2012

tj added a commit that referenced this issue Dec 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment