From e65c8bad46a190f3de7594d545aa4954ad17b85f Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 24 Sep 2018 12:56:31 +0700 Subject: vty/command.h: document and prettify CMD_ATTR_* flags Since the CMD_ATTR_* flags are intended to be used in bitwise operations, let's assign them proper values. Adding a new flag (e.g. CMD_ATTR_FOO_BAR) could actually result in assigning 0x03 instead of expected (0x01 << 2). Change-Id: I3b1badef830f7e6436a67673b5709ec33c060c68 Related: OS#3584 --- include/osmocom/vty/command.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 13d6e89d..d63dbdef 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -132,9 +132,10 @@ struct cmd_node { char name[64]; }; +/*! Attributes (flags) for \ref cmd_element */ enum { - CMD_ATTR_DEPRECATED = 1, - CMD_ATTR_HIDDEN, + CMD_ATTR_DEPRECATED = (1 << 0), + CMD_ATTR_HIDDEN = (1 << 1), }; /*! Structure of a command element */ -- cgit v1.2.3