Extract function comment using sedextract part of string using sedUsing sed to extract text between 2...

What does it mean when a vocal teacher tell you that your lowest notes are heavy?

How would a developer who mostly fixed bugs for years at a company call out their contributions in their CV?

xcolor breaking ligatures

Is there a simple example that empirical evidence is misleading?

Final exams: What is the most common protocol for scheduling?

What is the use case for non-breathable waterproof pants?

Co-author wants to put their current funding source in the acknowledgements section because they edited the paper

Testing using real data of the customer

Can we assume that a hash function with high collision resistance also means highly uniform distribution?

Count all vowels in string

What is the recommended procedure to land a taildragger in a crosswind?

If I arrive in the UK, and then head to mainland Europe, does my Schengen visa 90 day limit start when I arrived in the UK, or mainland Europe?

Is this homebrew "Cactus Grenade" cantrip balanced?

A burglar's sunglasses, a lady's odyssey

USPS Back Room - Trespassing?

Why is 'additive' EQ more difficult to use than 'subtractive'?

Is my plasma cannon concept viable?

Why does the Starter Set wizard have six spells in their spellbook?

Cardio work for Muay Thai fighters

Variable declaraton with extra in C

What are nvme namespaces? How do they work?

Can a UK national work as a paid shop assistant in the USA?

How to ethically utilize ability to transfer life from one human to another?

Sorting with IComparable design



Extract function comment using sed


extract part of string using sedUsing sed to extract text between 2 tagsComment multiple line using SEDHow to extract text using sedDeleting multiple lines of HTML comment using sedRemove commented lines except one comment using sedHow do I comment lines in fstab using sed?Extract information using sed regexsed comment multi-lineAdd (true || … ) to a function using sed






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I want to implement a simple utility that would take a C source file and a name of a function, struct, enum or whatever and output the comment directly above the element if present.



Ie.



/* This is a doc comment
* I want this comment extracted
*/
void function_foo(){

}


Usage:



utility file.c function_foo


Output:



This is a doc comment 
I want this comment extracted


The use case for this is that I want to use org-babel in emacs to tangle in documentation for functions right out of source files. Maybe there is a doxygen tool or clang tool that can do this? I just haven't found it yet. The end result would be that I can easily keep up to date documentation extracted from code directly inside my documentation org file that contains other things as well.










share|improve this question





























    0















    I want to implement a simple utility that would take a C source file and a name of a function, struct, enum or whatever and output the comment directly above the element if present.



    Ie.



    /* This is a doc comment
    * I want this comment extracted
    */
    void function_foo(){

    }


    Usage:



    utility file.c function_foo


    Output:



    This is a doc comment 
    I want this comment extracted


    The use case for this is that I want to use org-babel in emacs to tangle in documentation for functions right out of source files. Maybe there is a doxygen tool or clang tool that can do this? I just haven't found it yet. The end result would be that I can easily keep up to date documentation extracted from code directly inside my documentation org file that contains other things as well.










    share|improve this question

























      0












      0








      0








      I want to implement a simple utility that would take a C source file and a name of a function, struct, enum or whatever and output the comment directly above the element if present.



      Ie.



      /* This is a doc comment
      * I want this comment extracted
      */
      void function_foo(){

      }


      Usage:



      utility file.c function_foo


      Output:



      This is a doc comment 
      I want this comment extracted


      The use case for this is that I want to use org-babel in emacs to tangle in documentation for functions right out of source files. Maybe there is a doxygen tool or clang tool that can do this? I just haven't found it yet. The end result would be that I can easily keep up to date documentation extracted from code directly inside my documentation org file that contains other things as well.










      share|improve this question














      I want to implement a simple utility that would take a C source file and a name of a function, struct, enum or whatever and output the comment directly above the element if present.



      Ie.



      /* This is a doc comment
      * I want this comment extracted
      */
      void function_foo(){

      }


      Usage:



      utility file.c function_foo


      Output:



      This is a doc comment 
      I want this comment extracted


      The use case for this is that I want to use org-babel in emacs to tangle in documentation for functions right out of source files. Maybe there is a doxygen tool or clang tool that can do this? I just haven't found it yet. The end result would be that I can easily keep up to date documentation extracted from code directly inside my documentation org file that contains other things as well.







      sed programming org-mode






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 12 mins ago









      MartinMartin

      1313




      1313






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f520323%2fextract-function-comment-using-sed%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f520323%2fextract-function-comment-using-sed%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...