N_("association between file and process") },
[COL_CHRDRV] = { "CHRDRV", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING,
N_("charcter device driver name resolved by /proc/devices") },
- [COL_COMMAND] = { "COMMAND", 15, SCOLS_FL_TRUNC, SCOLS_JSON_STRING,
+ [COL_COMMAND] = { "COMMAND",0.3, SCOLS_FL_TRUNC, SCOLS_JSON_STRING,
N_("command of the process opening the file") },
[COL_DELETED] = { "DELETED", 0, SCOLS_FL_RIGHT, SCOLS_JSON_BOOLEAN,
N_("reachability from the file system") },
N_("mount id") },
[COL_MODE] = { "MODE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING,
N_("access mode (rwx)") },
- [COL_NAME] = { "NAME", 45, 0, SCOLS_JSON_STRING,
+ [COL_NAME] = { "NAME", 0.4, SCOLS_FL_TRUNC, SCOLS_JSON_STRING,
N_("name of the file") },
[COL_NLINK] = { "NLINK", 0, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER,
N_("link count") },
struct lsfd_control {
struct libscols_table *tb; /* output */
- unsigned int noheadings : 1,
- raw : 1,
- json : 1,
- threads : 1;
+ unsigned int noheadings : 1,
+ raw : 1,
+ json : 1,
+ notrunc : 1,
+ threads : 1;
};
static int column_name_to_id(const char *name, size_t namesz)
fputs(_(" -n, --noheadings don't print headings\n"), out);
fputs(_(" -o, --output <list> output columns\n"), out);
fputs(_(" -r, --raw use raw output format\n"), out);
+ fputs(_(" -u, --notruncate don't truncate text in columns\n"), out);
fputs(USAGE_SEPARATOR, out);
printf(USAGE_HELP_OPTIONS(23));
{ "json", no_argument, NULL, 'J' },
{ "raw", no_argument, NULL, 'r' },
{ "threads", no_argument, NULL, 'l' },
+ { "notruncate", no_argument, NULL, 'u' },
{ NULL, 0, NULL, 0 },
};
textdomain(PACKAGE);
close_stdout_atexit();
- while ((c = getopt_long(argc, argv, "no:JrVhl", longopts, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "no:JrVhlu", longopts, NULL)) != -1) {
switch (c) {
case 'n':
ctl.noheadings = 1;
case 'l':
ctl.threads = 1;
break;
+ case 'u':
+ ctl.notrunc = 1;
+ break;
case 'V':
print_version(EXIT_SUCCESS);
case 'h':
for (i = 0; i < ncolumns; i++) {
const struct colinfo *col = get_column_info(i);
struct libscols_column *cl;
+ int flags = col->flags;
- cl = scols_table_new_column(ctl.tb, col->name, col->whint, col->flags);
+ if (ctl.notrunc)
+ flags &= ~SCOLS_FL_TRUNC;
+ cl = scols_table_new_column(ctl.tb, col->name, col->whint, flags);
if (!cl)
err(EXIT_FAILURE, _("failed to allocate output column"));