# # # patch "tests/default_command_options/__driver__.lua" # from [08b5967edd5344aac720941c534e1426e872d13c] # to [cde1437cda224d838246f23a9dbde5d7d49bbcab] # # patch "tests/default_command_options/default_options.lua" # from [e5574902b08b2259b7e7c46f0b90e658287b3d3d] # to [3da2ea18eb81bf63c5fd58baaf0bfc0db2960663] # ============================================================ --- tests/default_command_options/__driver__.lua 08b5967edd5344aac720941c534e1426e872d13c +++ tests/default_command_options/__driver__.lua cde1437cda224d838246f23a9dbde5d7d49bbcab @@ -1,10 +1,29 @@ -- Demonstrate that get_default_command_options works, and that --- command line options override it. +-- command line options override it. Also show that --verbose +-- --no-verbose works. mtn_setup() check(get("default_options.lua")) +addfile("foo", "bar") +commit() + +check(mtn("log"), 0, true, false) +rename("stdout", "normallog") + +check(mtn("log", "--brief"), 0, true, false) +rename("stdout", "brieflog") + +check(mtn("log", "--rcfile=default_options.lua"), 0, true, false) +check(samefile("stdout", "brieflog")) + +check(mtn("log", "--brief", "--no-brief"), 0, true, false) +check(samefile("stdout", "normallog")) + +check(mtn("log", "--rcfile=default_options.lua", "--no-brief"), 0, true, false) +check(samefile("stdout", "normallog")) + check(mtn("version", "--no-verbose"), 0, true, false) rename("stdout", "normalversion") ============================================================ --- tests/default_command_options/default_options.lua e5574902b08b2259b7e7c46f0b90e658287b3d3d +++ tests/default_command_options/default_options.lua 3da2ea18eb81bf63c5fd58baaf0bfc0db2960663 @@ -4,6 +4,9 @@ function get_default_command_options(com if (command[1] == "version") then table.insert(default_opts, "--verbose") end + if (command[1] == "log") then + table.insert(default_opts, "--brief") + end -- should trigger an invalid option error if (command[1] == "status") then table.insert(default_opts, "--foobarbaz")