From e032b157d18fabaad979b2fe41779514996117f4 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 16 Apr 2019 15:11:51 -0700 Subject: Replace highline with tty-screen in knife list One step closer to killing off highline. We're just getting the terminal width here, which is super overkill for highline. We're still using it in quite a few other places, but this gets us one step closer to moving over to tty entirely. Signed-off-by: Tim Smith --- lib/chef/knife/list.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/chef/knife/list.rb b/lib/chef/knife/list.rb index 5d95790a26..03954dcf00 100644 --- a/lib/chef/knife/list.rb +++ b/lib/chef/knife/list.rb @@ -25,30 +25,35 @@ class Chef deps do require "chef/chef_fs/file_system" - require "highline" + require "tty-screen" end option :recursive, short: "-R", boolean: true, description: "List directories recursively" + option :bare_directories, short: "-d", boolean: true, description: "When directories match the pattern, do not show the directories' children" + option :local, long: "--local", boolean: true, description: "List local directory instead of remote" + option :flat, short: "-f", long: "--flat", boolean: true, description: "Show a list of filenames rather than the prettified ls-like output normally produced" + option :one_column, short: "-1", boolean: true, description: "Show only one column of results" + option :trailing_slashes, short: "-p", boolean: true, @@ -143,7 +148,7 @@ class Chef if config[:one_column] || !stdout.isatty columns = 0 else - columns = HighLine::SystemExtensions.terminal_size[0] + columns = TTY::Screen.columns end current_line = "" results.each do |result| -- cgit v1.2.1