001package org.unix4j.unix.tail; 002 003import org.unix4j.unix.Tail; 004 005/** 006 * Options for the {@link Tail tail} command with the 007 * the following options: 008 * <p> 009 * <table> 010 * <tr valign="top"><td width="10px"></td><td nowrap="nowrap">{@code -c}</td><td> </td><td nowrap="nowrap">{@code --chars}</td><td> </td><td>The {@code count} argument is in units of characters instead of 011 lines. Starts from 1 and includes line ending characters.</td></tr> 012 * <tr valign="top"><td width="10px"></td><td nowrap="nowrap">{@code -q}</td><td> </td><td nowrap="nowrap">{@code --suppressHeaders}</td><td> </td><td>Suppresses printing of headers when multiple files are being 013 examined.</td></tr> 014 * <tr valign="top"><td width="10px"></td><td nowrap="nowrap">{@code -s}</td><td> </td><td nowrap="nowrap">{@code --countFromStart}</td><td> </td><td>The {@code count} argument is relative to the beginning of the file 015 instead of counting from the end of the file. For instance, 016 {@code tail -s 10} prints the lines starting from line 10; 017 {@code tail -s 1} prints the whole file.</td></tr> 018 * </table> 019 * <p> 020 * This class serves as entry point to every possible set of {@code tail} options 021 * defined as an enum constant. With this explicit expansion of all possible 022 * option combinations, options can be passed to the command in a very compact 023 * form, such as: 024 * <pre> 025 * tail(Tail.Options.c, ...); 026 * tail(Tail.Options.c.q, ...); 027 * ... 028 * tail(Tail.Options.c.q.s, ...); 029 * </pre> 030 */ 031public final class TailOptionSets { 032 /** 033 * The singleton instance. 034 */ 035 public static final TailOptionSets INSTANCE = new TailOptionSets(); 036 037 /** 038 * Option {@code "-c"}: The {@code count} argument is in units of characters instead of 039 lines. Starts from 1 and includes line ending characters. 040 * <p> 041 * The option {@code "-c"} is equivalent to the {@code "--}{@link #chars chars}{@code "} option. 042 */ 043 public final TailOptionSet_cqs c = TailOptionSet_cqs.Active_c; 044 /** 045 * Option {@code "--chars"}: The {@code count} argument is in units of characters instead of 046 lines. Starts from 1 and includes line ending characters. 047 * <p> 048 * The option {@code "--chars"} is equivalent to the {@code "-}{@link #c c}{@code "} option. 049 */ 050 public final TailOptionSet_cqs chars = TailOptionSet_cqs.Active_c_long; 051 /** 052 * Option {@code "-s"}: The {@code count} argument is relative to the beginning of the file 053 instead of counting from the end of the file. For instance, 054 {@code tail -s 10} prints the lines starting from line 10; 055 {@code tail -s 1} prints the whole file. 056 * <p> 057 * The option {@code "-s"} is equivalent to the {@code "--}{@link #countFromStart countFromStart}{@code "} option. 058 */ 059 public final TailOptionSet_cqs s = TailOptionSet_cqs.Active_s; 060 /** 061 * Option {@code "--countFromStart"}: The {@code count} argument is relative to the beginning of the file 062 instead of counting from the end of the file. For instance, 063 {@code tail -s 10} prints the lines starting from line 10; 064 {@code tail -s 1} prints the whole file. 065 * <p> 066 * The option {@code "--countFromStart"} is equivalent to the {@code "-}{@link #s s}{@code "} option. 067 */ 068 public final TailOptionSet_cqs countFromStart = TailOptionSet_cqs.Active_s_long; 069 /** 070 * Option {@code "-q"}: Suppresses printing of headers when multiple files are being 071 examined. 072 * <p> 073 * The option {@code "-q"} is equivalent to the {@code "--}{@link #suppressHeaders suppressHeaders}{@code "} option. 074 */ 075 public final TailOptionSet_cqs q = TailOptionSet_cqs.Active_q; 076 /** 077 * Option {@code "--suppressHeaders"}: Suppresses printing of headers when multiple files are being 078 examined. 079 * <p> 080 * The option {@code "--suppressHeaders"} is equivalent to the {@code "-}{@link #q q}{@code "} option. 081 */ 082 public final TailOptionSet_cqs suppressHeaders = TailOptionSet_cqs.Active_q_long; 083 084}