]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: use '\n' as IFS when ask for filenames
authorKarel Zak <kzak@redhat.com>
Mon, 30 Sep 2013 13:49:00 +0000 (15:49 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Sep 2013 13:49:00 +0000 (15:49 +0200)
The bash completion for more(1) treats the space-separated pieces of
filenames as different files.

$ touch foo\ bar
$ more foo<TAB>
bar foo

Reported-by: Ángel González <ingenit@zoho.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
46 files changed:
bash-completion/blkid
bash-completion/colcrt
bash-completion/column
bash-completion/cytune
bash-completion/dmesg
bash-completion/fallocate
bash-completion/findmnt
bash-completion/flock
bash-completion/fsck.cramfs
bash-completion/hexdump
bash-completion/hwclock
bash-completion/ionice
bash-completion/last
bash-completion/ldattach
bash-completion/logger
bash-completion/look
bash-completion/losetup
bash-completion/lscpu
bash-completion/lslocks
bash-completion/mcookie
bash-completion/mkfs.cramfs
bash-completion/mkswap
bash-completion/more
bash-completion/mount
bash-completion/mountpoint
bash-completion/namei
bash-completion/nsenter
bash-completion/pg
bash-completion/pivot_root
bash-completion/readprofile
bash-completion/rename
bash-completion/rev
bash-completion/script
bash-completion/scriptreplay
bash-completion/setterm
bash-completion/sfdisk
bash-completion/su
bash-completion/swaplabel
bash-completion/tailf
bash-completion/tunelp
bash-completion/ul
bash-completion/utmpdump
bash-completion/uuidd
bash-completion/wall
bash-completion/wdctl
bash-completion/whereis

index b4393285878d1ab68e11076db942151ca703730f..9f97dd94ece65e0cee16516bb4eafbd725f394b7 100644 (file)
@@ -6,6 +6,7 @@ _blkid_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-c')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index f9e4c333fcf023d39e954cfc166a6f07b09650a5..c66d7e6d6e81ce1fe61726b1db1a61c409c09dd3 100644 (file)
@@ -19,6 +19,7 @@ _colcrt_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index f5cb86b9c2ff9b6823b5eb4556bfd4bafda0a207..3af8e736adb92f58d4b38c76c81117d14136c470 100644 (file)
@@ -30,6 +30,7 @@ _column_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 4f42838050313304d7e5cc274ab879cae1f98949..f685c88ee6c7001c6c47b0530baa2132989b2ad7 100644 (file)
@@ -33,6 +33,7 @@ _cytune_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- ${cur:-"/dev/tty"}) )
        return 0
index 60ecc1af60a50bb919713f0d0dc9066bbe297d14..eab41ba086bb113dee27b335c936ee14584e4e63 100644 (file)
@@ -6,6 +6,7 @@ _dmesg_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-F'|'--file')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index 5007b605e04cff26c9e140b46873f3f2d6abd9b4..2c6e4cbae756d947f541dd1bfbfe06fd2287401b 100644 (file)
@@ -20,6 +20,7 @@ _fallocate_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 9386d8f5a88c8bb1584caa5df28a88800d6def28..3ed331ac032bc333300c7539fb087e554c6795e8 100644 (file)
@@ -18,6 +18,7 @@ _findmnt_module()
                        return 0
                        ;;
                '-F'|'--tab-file')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index 8cd60d33e5ffe6470d5810563a59b7e6d7f42785..8e7f8b8592dae8f045619419422ff47ecfcd0b51 100644 (file)
@@ -38,6 +38,7 @@ _flock_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- ${cur:-"/"}) )
        return 0
index 84f6f31b462f1008b14c34c41969c50e37d098ad..acf656411d61d07a52f208de167b20dcdac7a00f 100644 (file)
@@ -6,6 +6,7 @@ _fsck.cramfs_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-x'|'--destination')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
                        return 0
index aa6f8cefd4f67521719bb14d566cbf044b1aa0d0..9dc2740769fc4918594f50e5ea0fac4dfdca7324 100644 (file)
@@ -40,6 +40,7 @@ _hexdump_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 0c4ebafc19ecb615a76a583f5dc22238607340f7..de1ac20f356491b176427d595058eb05f3e2576d 100644 (file)
@@ -6,6 +6,7 @@ _hwclock_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-f'|'--rtc'|'--adjfile')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index 3a01c5125f1ed1b650e720b13b9ad9e51516fc0c..1b1c5fe0ad04d032b019e4af2f130e5ba7d87ceb 100644 (file)
@@ -30,6 +30,7 @@ _ionice_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 493051e64dc7a6e05fb4143da8d69cd7c086ff51..c93be3d438c2da1225f89f29a9d8756b4805125a 100644 (file)
@@ -6,6 +6,7 @@ _last_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-f')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index 830142d2352664aa82bb6b64eb56520d585c4625..0b9d2603452dd8cdcaa6f8b445401ae8ce1efe79 100644 (file)
@@ -42,6 +42,7 @@ _ldattach_module()
                        return 0
                        ;;
                /*)
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index f46be8ad029eed781c6636610e60eea4e97d1127..963abc7040512172b7a877794c1ea49c0d628f02 100644 (file)
@@ -6,6 +6,7 @@ _logger_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-f'|'--file')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index e8676bae47dd50830189dd0e054103b54f6fa204..303a7565a3096d3f857f881c514742a2f18fa3df 100644 (file)
@@ -20,6 +20,7 @@ _look_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 75240b8c93348e1010b94fc23c305b0b25dd88fd..874c549ae3bbb1dbac695159dc252a31b37019e1 100644 (file)
@@ -60,6 +60,7 @@ _losetup_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 27367426a99dc59161bd37a65d5df0353f37b67d..7e189eee6bae100ea9c0f7bb669633d4fbbe5a49 100644 (file)
@@ -42,6 +42,7 @@ _lscpu_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 337d07e04b260c8404c2879fa41b2d9e3b6750d1..c9cff2c6b7a31192aa2d629f282912d7986824eb 100644 (file)
@@ -38,6 +38,7 @@ _lslocks_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index eb3f54b5f70db214cf0ea8d29379c61cae6111cc..4345b6e6c24a08652b9fe96ba6502ee4d81bf36c 100644 (file)
@@ -6,6 +6,7 @@ _mcookie_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-f'|'--file')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index 38ab3b65f84979fa65047c8d13a862accc624166..af74e1212a456a381c42d7cb5124852069790d63 100644 (file)
@@ -36,6 +36,7 @@ _mkfs.cramfs_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index c411b3005400dd2df42d7536cb77773e40671560..b72efafd9aaf09e1e1e89f1c2a4e4e17578f6dba 100644 (file)
@@ -28,6 +28,7 @@ _mkswap_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 945c7b341239674252a11ab38ef8d2a4180984a6..809cea2b35e385d6eaa965e6a043c18837f3c3d3 100644 (file)
@@ -21,6 +21,8 @@ _more_module()
                        return 0
                        ;;
        esac
+
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 2303cb7c19ddf2afd36df41416c6d668ea12e995..db97a918acdd8b038d52c7940c16ebfb58bc00c2 100644 (file)
@@ -80,6 +80,7 @@ hfs     nohfs         romfs     noromfs
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 8fe27b813e16d63ef3d11a027cbe747fb3f29c8b..f74efc9cc2520c6bbb3887034169583caacd7bda 100644 (file)
@@ -20,6 +20,7 @@ _mountpoint_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- ${cur:-"/"}) )
        return 0
index 63fb37ac18a56759d81fb7e89a15bc87b15d64c6..640273500a19b92e27bbf76b08c037d9dbbaa6db 100644 (file)
@@ -16,6 +16,7 @@ _namei_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 2970b8d5ef7db291256fc5406f58f4cd9dff97e3..268f3782c5e0a7edaf37655feaa21788a65927df 100644 (file)
@@ -40,6 +40,7 @@ _nsenter_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 9b1bad93097aa3538d93d113653adc9f5d64d2b4..8fce1302abe5eb23d58f3ac0b03490bb0bf8b165 100644 (file)
@@ -25,6 +25,7 @@ _pg_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 961c8837482d0a2b7c4e43e021c66d2a8f875d74..95df4b4d2f10be1a4ce5500391b04e9d2d31a681 100644 (file)
@@ -11,6 +11,7 @@ _pivot_root_module()
        esac
        case $COMP_CWORD in
                1|2)
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
                        ;;
index a5f45f56408802fc7f969f344763720711f4d5ca..bd265a69a220f023d1251792fa5a1324c4fb0f9b 100644 (file)
@@ -6,6 +6,7 @@ _readprofile_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-m'|'--mapfile'|'-p'|'--profile')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index 3842c4d149050fbde9847231e4ca0226074dc161..81365a5b22f4491b74131de48c5cc47a8062a901 100644 (file)
@@ -24,6 +24,7 @@ _rename_module()
                        COMPREPLY=( $(compgen -W "replacement" -- $cur) )
                        ;;
                *)
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        ;;
index 619c5c4f6757180605e7ee5441caaf873f943cde..e5397d5d88d249482d1e5e5b4a52e76cb12c073b 100644 (file)
@@ -16,6 +16,7 @@ _rev_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 329fc482faa7ebf1ecaba434ae8b848b7af76e1a..d7efd7e7c2c1a7f6a9d120fe7d8e6512ae94b9fd 100644 (file)
@@ -32,6 +32,7 @@ _script_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 2ad7b118c7ab94f477d7f2e453cab5afef6e6e76..a4aa8a08d2e963c8df391b50723d1f02501f52d5 100644 (file)
@@ -24,6 +24,7 @@ _scriptreplay_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 7fa0a4e457f63a462863d72b40478c87d7ad90b1..a7ef6ebed4695b423487b8922d3685a79b1d763e 100644 (file)
@@ -45,6 +45,7 @@ _setterm_module()
                        return 0
                        ;;
                '-file')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index 0226b0483ec8b2071d55e132c37322a1153fa5af..609104ca31c9c764b300f9980885f962c179bbb5 100644 (file)
@@ -14,6 +14,7 @@ _sfdisk_module()
                        return 0
                        ;;
                '-O'|'-I')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
index e739b56d91a0d3600e43169d2c2ffc41700f79c7..dad1b5f045d0ec0161f81998f90c512bb56e0674 100644 (file)
@@ -38,6 +38,7 @@ _su_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 093169e0602d25b5d76824f85ff30c35158b6977..08aa9cd79fa125a01e022a062fc47d1212211515 100644 (file)
@@ -24,6 +24,7 @@ _swaplabel_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index e3dd295b1a22f54f7e9f3a617bc6bd17dfae162d..0d4c869c09c4853949ecc0b0ee3ef8118f60f791 100644 (file)
@@ -20,6 +20,7 @@ _tailf_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 614b2354f471d28a150d713da9224d7794ae8f9a..bd2cce2aa2705d056c5b4772c7e6036d4ede2347 100644 (file)
@@ -44,6 +44,7 @@ _tunelp_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- ${cur:-"/dev/lp"}) )
        return 0
index c00e510f633fc048f5d042c883dfefff23b0a830..449cbe0543be5838b5f4db5fc358d1af85d58a17 100644 (file)
@@ -25,6 +25,7 @@ _ul_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 48af5bc7f9c556f0441347482b72b1c3630ede60..fb636c18a76a79a881c051145e817a3618f5ea55 100644 (file)
@@ -16,6 +16,7 @@ _utmpdump_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index c45b0674c5d746860a6bc091ec8954ff52d806cb..c8f6697c9b887df35bfbc3d4e4e520d2cf7eec61 100644 (file)
@@ -6,16 +6,19 @@ _uuidd_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-p'|'--pid'|'-s'|'--socket')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
                        return 0
                        ;;
                '-T'|'--timeout')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -W "timeout" -- $cur) )
                        return 0
                        ;;
                '-n'|'--uuids')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -W "number" -- $cur) )
                        return 0
index 55d96587e8606e4ceb178d65fae46020bf36370d..e3145ff6d7e94fca141ebbc968356cab357d4db9 100644 (file)
@@ -20,6 +20,7 @@ _wall_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- $cur) )
        return 0
index 33b4e1ff611ef59e484235ac04bdb4e359499841..4f16e760721e8a394507058ee303c9bf560c40c8 100644 (file)
@@ -56,6 +56,7 @@ _wdctl_module()
                        return 0
                        ;;
        esac
+       local IFS=$'\n'
        compopt -o filenames
        COMPREPLY=( $(compgen -f -- ${cur:-"/dev/"}) )
        return 0
index 2273a07c5df77e00dead20598fb4bacbdfbf71df..0dcbac35bc56b47fe8ba73105049ae82645fe157 100644 (file)
@@ -6,6 +6,7 @@ _whereis_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-B'|'-M'|'-S')
+                       local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
                        return 0