+
+/* "[-]Cadil1", POSIX mandated options, busybox always supports */
+/* "[-]gnsx", POSIX non-mandated options, busybox always supports */
+/* "[-]Ak" GNU options, busybox always supports */
+/* "[-]FLRctur", POSIX mandated options, busybox optionally supports */
+/* "[-]p", POSIX non-mandated options, busybox optionally supports */
+/* "[-]SXvThw", GNU options, busybox optionally supports */
+/* "[-]K", SELinux mandated options, busybox optionally supports */
+/* "[-]e", I think we made this one up */
+
+#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
+# define LS_STR_TIMESTAMPS "cetu"
+#else
+# define LS_STR_TIMESTAMPS ""
+#endif
+
+#ifdef CONFIG_FEATURE_LS_SORTFILES
+# define LS_STR_SORTFILES "SXrv"
+#else
+# define LS_STR_SORTFILES ""
+#endif
+
+#ifdef CONFIG_FEATURE_LS_FILETYPES
+# define LS_STR_FILETYPES "Fp"
+#else
+# define LS_STR_FILETYPES ""
+#endif
+
+#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
+# define LS_STR_FOLLOW_LINKS "L"
+#else
+# define LS_STR_FOLLOW_LINKS ""
+#endif
+
+#ifdef CONFIG_FEATURE_LS_RECURSIVE
+# define LS_STR_RECURSIVE "R"
+#else
+# define LS_STR_RECURSIVE ""
+#endif
+
+#ifdef CONFIG_FEATURE_HUMAN_READABLE
+# define LS_STR_HUMAN_READABLE "h"
+#else
+# define LS_STR_HUMAN_READABLE ""
+#endif
+
+#ifdef CONFIG_SELINUX
+# define LS_STR_SELINUX "K"
+#else
+# define LS_STR_SELINUX ""
+#endif
+
+#ifdef CONFIG_FEATURE_AUTOWIDTH
+# define LS_STR_AUTOWIDTH "T:w:"
+#else
+# define LS_STR_AUTOWIDTH ""
+#endif
+
+static const char ls_options[]="Cadil1gnsxAk" \
+ LS_STR_TIMESTAMPS \
+ LS_STR_SORTFILES \
+ LS_STR_FILETYPES \
+ LS_STR_FOLLOW_LINKS \
+ LS_STR_RECURSIVE \
+ LS_STR_HUMAN_READABLE \
+ LS_STR_SELINUX \
+ LS_STR_AUTOWIDTH;
+
+#define LIST_MASK_TRIGGER 0
+#define STYLE_MASK_TRIGGER STYLE_MASK
+#define SORT_MASK_TRIGGER SORT_MASK
+#define DISP_MASK_TRIGGER DISP_ROWS
+#define TIME_MASK_TRIGGER TIME_MASK
+
+static const unsigned opt_flags[] = {
+ LIST_SHORT | STYLE_COLUMNS, /* C */
+ DISP_HIDDEN | DISP_DOT, /* a */
+ DISP_NOLIST, /* d */
+ LIST_INO, /* i */
+ LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
+ LIST_SHORT | STYLE_SINGLE, /* 1 */
+ 0, /* g - ingored */
+ LIST_ID_NUMERIC, /* n */
+ LIST_BLOCKS, /* s */
+ DISP_ROWS, /* x */
+ DISP_HIDDEN, /* A */
+#ifdef CONFIG_SELINUX
+ LIST_CONTEXT, /* k */
+#else
+ 0, /* k - ingored */
+#endif
+#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
+# ifdef CONFIG_FEATURE_LS_SORTFILES
+ TIME_CHANGE | SORT_CTIME, /* c */
+# else
+ TIME_CHANGE, /* c */
+# endif
+ LIST_FULLTIME, /* e */
+# ifdef CONFIG_FEATURE_LS_SORTFILES
+ SORT_MTIME, /* t */
+# else
+ 0, /* t - ignored -- is this correct? */
+# endif
+# ifdef CONFIG_FEATURE_LS_SORTFILES
+ TIME_ACCESS | SORT_ATIME, /* u */
+# else
+ TIME_ACCESS, /* u */
+# endif
+#endif
+#ifdef CONFIG_FEATURE_LS_SORTFILES
+ SORT_SIZE, /* S */
+ SORT_EXT, /* X */
+ SORT_ORDER_REVERSE, /* r */
+ SORT_VERSION, /* v */
+#endif
+#ifdef CONFIG_FEATURE_LS_FILETYPES
+ LIST_FILETYPE | LIST_EXEC, /* F */
+ LIST_FILETYPE, /* p */
+#endif
+#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
+ FOLLOW_LINKS, /* L */
+#endif
+#ifdef CONFIG_FEATURE_LS_RECURSIVE
+ DISP_RECURSIVE, /* R */
+#endif
+#ifdef CONFIG_FEATURE_HUMAN_READABLE
+ LS_DISP_HR, /* h */
+#endif
+#ifdef CONFIG_SELINUX
+ LIST_MODEBITS|LIST_NLINKS|LIST_CONTEXT|LIST_SIZE|LIST_DATE_TIME, /* K */
+#endif
+ (1U<<31)
+};
+
+
+/*----------------------------------------------------------------------*/
+