001package org.unix4j.unix.uniq; 002 003import org.unix4j.unix.Uniq; 004 005/** 006 * Options for the {@link Uniq uniq} 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 --count}</td><td> </td><td>Precedes each output line with a count of the number of times the 011 line occurred in the input.</td></tr> 012 * <tr valign="top"><td width="10px"></td><td nowrap="nowrap">{@code -d}</td><td> </td><td nowrap="nowrap">{@code --duplicatedOnly}</td><td> </td><td>Suppresses the writing of lines that are not repeated in the input.</td></tr> 013 * <tr valign="top"><td width="10px"></td><td nowrap="nowrap">{@code -u}</td><td> </td><td nowrap="nowrap">{@code --uniqueOnly}</td><td> </td><td>Suppresses the writing of lines that are repeated in the input.</td></tr> 014 * <tr valign="top"><td width="10px"></td><td nowrap="nowrap">{@code -g}</td><td> </td><td nowrap="nowrap">{@code --global}</td><td> </td><td>Suppresses repeated lines globally, that is, if lines are 015 non-adjacent. This option guarantees unique output lines even if the 016 input lines are not sorted.</td></tr> 017 * </table> 018 * <p> 019 * This class serves as entry point to every possible set of {@code uniq} options 020 * defined as an enum constant. With this explicit expansion of all possible 021 * option combinations, options can be passed to the command in a very compact 022 * form, such as: 023 * <pre> 024 * uniq(Uniq.Options.c, ...); 025 * uniq(Uniq.Options.c.d, ...); 026 * ... 027 * uniq(Uniq.Options.c.d.u.g, ...); 028 * </pre> 029 */ 030public final class UniqOptionSets { 031 /** 032 * The singleton instance. 033 */ 034 public static final UniqOptionSets INSTANCE = new UniqOptionSets(); 035 036 /** 037 * Option {@code "-c"}: Precedes each output line with a count of the number of times the 038 line occurred in the input. 039 * <p> 040 * The option {@code "-c"} is equivalent to the {@code "--}{@link #count count}{@code "} option. 041 */ 042 public final UniqOptionSet_cg c = UniqOptionSet_cg.Active_c; 043 /** 044 * Option {@code "--count"}: Precedes each output line with a count of the number of times the 045 line occurred in the input. 046 * <p> 047 * The option {@code "--count"} is equivalent to the {@code "-}{@link #c c}{@code "} option. 048 */ 049 public final UniqOptionSet_cg count = UniqOptionSet_cg.Active_c_long; 050 /** 051 * Option {@code "-d"}: Suppresses the writing of lines that are not repeated in the input. 052 * <p> 053 * The option {@code "-d"} is equivalent to the {@code "--}{@link #duplicatedOnly duplicatedOnly}{@code "} option. 054 */ 055 public final UniqOptionSet_dg d = UniqOptionSet_dg.Active_d; 056 /** 057 * Option {@code "--duplicatedOnly"}: Suppresses the writing of lines that are not repeated in the input. 058 * <p> 059 * The option {@code "--duplicatedOnly"} is equivalent to the {@code "-}{@link #d d}{@code "} option. 060 */ 061 public final UniqOptionSet_dg duplicatedOnly = UniqOptionSet_dg.Active_d_long; 062 /** 063 * Option {@code "-g"}: Suppresses repeated lines globally, that is, if lines are 064 non-adjacent. This option guarantees unique output lines even if the 065 input lines are not sorted. 066 * <p> 067 * The option {@code "-g"} is equivalent to the {@code "--}{@link #global global}{@code "} option. 068 */ 069 public final UniqOptionSet_cdgu g = UniqOptionSet_cdgu.Active_g; 070 /** 071 * Option {@code "--global"}: Suppresses repeated lines globally, that is, if lines are 072 non-adjacent. This option guarantees unique output lines even if the 073 input lines are not sorted. 074 * <p> 075 * The option {@code "--global"} is equivalent to the {@code "-}{@link #g g}{@code "} option. 076 */ 077 public final UniqOptionSet_cdgu global = UniqOptionSet_cdgu.Active_g_long; 078 /** 079 * Option {@code "-u"}: Suppresses the writing of lines that are repeated in the input. 080 * <p> 081 * The option {@code "-u"} is equivalent to the {@code "--}{@link #uniqueOnly uniqueOnly}{@code "} option. 082 */ 083 public final UniqOptionSet_gu u = UniqOptionSet_gu.Active_u; 084 /** 085 * Option {@code "--uniqueOnly"}: Suppresses the writing of lines that are repeated in the input. 086 * <p> 087 * The option {@code "--uniqueOnly"} is equivalent to the {@code "-}{@link #u u}{@code "} option. 088 */ 089 public final UniqOptionSet_gu uniqueOnly = UniqOptionSet_gu.Active_u_long; 090 091}